package net.fdukedom.epicurus.client.ui;

import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;
import javax.swing.JFrame;
import javax.swing.JDialog;
/**
 * 
 * @author Alexander Kirakozov
 */
public abstract class ShowDialogAction extends AbstractAction {
   /**
    * Main frame
    */
    protected JFrame mainFrame;

    /**
     * Constructor
     * @param frame main frame
     */
    public ShowDialogAction(JFrame frame, String title) {
        super(title, null);
        mainFrame = frame;
    }

    /**
     * Action. Show connection options profile dialog.
     */
    public void actionPerformed(ActionEvent arg0) {
       JDialog dialog = createDialog();
    
       dialog.setVisible(true);
    }

    /**
     * Creates modal dialog
     * @return modal dialog
     */
    protected abstract JDialog createDialog();
}
